package mr

//
// RPC definitions.
//
// remember to capitalize all names.
//

import (
	"os"
	"strconv"
	"time"
)

//
// example to show how to declare the arguments
// and reply for an RPC.
//

type ExampleArgs struct {
	X int
}

type ExampleReply struct {
	Y int
}

// Add your RPC definitions here.
type NullArgs struct {
}
type WorkInfo struct {
	Kind          int //work kind, 0 for map, 1 for reduce, -1 for all done, and 2 for wait
	TaskId        int
	Status        int /* 0 begin 1 doing 2 end*/
	ReduceTaskNum int /*Used for hash*/
	MapTaskNum    int
	Filename      string
	t             time.Time
}

// Cook up a unique-ish UNIX-domain socket name
// in /var/tmp, for the coordinator.
// Can't use the current directory since
// Athena AFS doesn't support UNIX-domain sockets.
func coordinatorSock() string {
	s := "/var/tmp/824-mr-"
	s += strconv.Itoa(os.Getuid())
	return s
}
